<style>
div {
    border: 1px solid black;
    background: white;
    padding: 15px;
}
</style>

<<template>
  <div id='secondChild'>
      <h2>secondChild组件</h2>
      <p>从firstChild接收的字符串参数: {{msg}}</p>
  </div>
</template>


<script>
import bus from '../assets/eventBus';
export default {
    data() {
        return{
            msg:'默认值'
        }
    },
    mounted(){
        var self = this;
        console.log('this1',this);
        bus.$on('defindEvent',function(msg){
            self.msg = msg;
            console.log("this2",this);
        })
    }
} 
</script>

